import React, { useState } from 'react';
import { Button, Divider } from 'antd';

// 扩大十倍
const countCalc = (count: any) => {
  return 10 * count;
};

export default () => {
  const [count, setCount] = useState(() => countCalc(1));

  console.log(1);

  // 树苗增加
  const handleIn = () => {
    setCount(count + 1);
    console.log(4);
  };

  console.log(2);

  return (
    <div>
      {console.log(3)}
      {`当前的树苗数量：${count}`}
      <Divider />
      <Button type="primary" onClick={handleIn}>
        树苗+1
      </Button>
    </div>
  );
};
